package com.caoheng.core.common;


import com.caoheng.core.enums.ResultEnum;
import lombok.Data;
import org.springframework.util.StringUtils;

public class Result {

    private int code;

    private Object data;

    private String msg;

    public Result(){}

    public Result(ResultEnum resultEnum){
        this.code = resultEnum.getType();
        this.msg = resultEnum.getTip();

    }

    public Result(int code,String msg){
        this.code = code;
        this.msg = msg;
    }

    public Result(ResultEnum resultEnum,Object data){
        this.code = resultEnum.getType();
        this.msg = resultEnum.getTip();
        this.data = data;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
